package com.xjscrm.console.web.group;

import com.xjscrm.console.param.BaseDto;
import com.xjscrm.console.param.group.CheckRepeatMemberDto;
import com.xjscrm.console.param.group.DeleRepeatMemberDto;
import com.xjscrm.console.param.group.RepeatWwGroupMerberQuery;
import com.xjscrm.console.param.wwCustomer.CheckRepeatWwCustomerDto;
import com.xjscrm.console.param.wwCustomer.DeleRepeatWwCustomerDto;
import com.xjscrm.console.param.wwCustomer.RepeatWwCustomerQuery;
import com.xjscrm.console.service.customer.group.WwGroupMemberDistinctService;
import com.xjscrm.console.vo.RepeatWwCustomerVo;
import com.xjscrm.console.vo.RepeatWwGroupMerberVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "客户群成员去重管理", tags = "客户群成员去重管理")
@RestController
@RequestMapping(value = "/wwGroup/member/distint")
public class WwGroupMemberDistinctController {

    @Autowired
    private WwGroupMemberDistinctService wwGroupMemberDistinctService;

    @ApiOperation(value = "检测重复的群成员", notes = "检测重复的群成员",response = Boolean.class)
    @PostMapping(value ="/checkRepeatMember" )
    public Object checkRepeatMember(@RequestBody CheckRepeatMemberDto checkRepeatMemberDto)throws Exception{
        wwGroupMemberDistinctService.checkRepeatMember(checkRepeatMemberDto);
        return true;
    }

    @ApiOperation(value = "取消检测重复的群成员", notes = "取消检测重复的群成员",response = Boolean.class)
    @PostMapping(value ="/breakCheck" )
    public Object breakCheck(@RequestBody BaseDto baseDto)throws Exception{
        wwGroupMemberDistinctService.breakCheck(baseDto);
        return true;
    }
    @ApiOperation(value = "获取检测状态", notes = "获取检测状态",response = Boolean.class)
    @PostMapping(value ="/getCheckStatus" )
    public Object getCheckStatus(@RequestBody BaseDto baseDto)throws Exception{
        return wwGroupMemberDistinctService.getCheckStatus(baseDto);
    }

    @ApiOperation(value = "获取检测结果", notes = "获取检测结果",response = RepeatWwGroupMerberVo.class)
    @PostMapping(value ="/getCheckResult" )
    public Object getCheckResult(@RequestBody RepeatWwGroupMerberQuery repeatWwGroupMerberQuery)throws Exception{
        return   wwGroupMemberDistinctService.getCheckResult(repeatWwGroupMerberQuery);
    }

    @ApiOperation(value = "去重群成员", notes = "去重群成员",response = Integer.class)
    @PostMapping(value ="/deleRepeatMember" )
    public Object deleRepeatMember(@RequestBody DeleRepeatMemberDto DeleRepeatMemberDto)throws Exception{
        return wwGroupMemberDistinctService.deleRepeatMember(DeleRepeatMemberDto);

    }

}
